A spherical pendulum is a generalization of the pendulum. It consists of a mass moving without friction on a sphere. The only forces acting on the mass are the reaction from the sphere and gravity.
It is convenient to use spherical coordinates and describe the position of the mass in terms of , where r is fixed.
The Lagrangian is
The Euler-Lagrange equations give
and
showing that angular momentum is conserved.
And the Hamiltonian is
where
and
Reference: Landau-Lifschitz, Course of Theoretical Physics Volume 1, Mechanics, p.33/34. In particular, the integration is done and the turning points are discussed.